import request from '@/utils/axios';
import appName from "../appName"

//续期任务查询
export function page(params) {
    return request({
        url: appName.TASK + '/renewal/task/pageinfo',
        method: 'post',
        data: params
    })
}

//核保工作池 查询条件动态下拉框
export function queryUdwWorkPoolSelectFlag01() {
    return request({
        url: appName.NB + `/common/select/queryUdwWorkPoolSelectFlag01`,
        method: 'get',
    })
}

//获取当前用户的信息以及存储过程的时间
export function getLogonUserAndGlBusinessDate() {
    return request({
        url: appName.NB + `/renewal/renewal/getLogonUserAndGlBusinessDate`,
        method: 'get',
    })
}

//保单是否存在
export function checkChdrnumFromChdrenqByChdrcoyChdrnum(chdrnum, usercomp) {
    return request({
        url: appName.NB + `/renewal/renewal/checkChdrnumFromChdrenqByChdrcoyChdrnum?chdrnum=${chdrnum}&chdrcoy=${usercomp}`,
        method: 'get',
    })
}

//获取保单资料
export function callEUIS044(chdrnum, usercomp) {
    return request({
        url: appName.NB + `/renewal/renewal/callEUIS044?chdrnum=${chdrnum}&chdrcoy=${usercomp}`,
        method: 'get',
    })
}

//根据保单号码查询最小的Rrtdat
export function findMinRrtdatFromCovrByChdrnum(chdrnum) {
    return request({
        url: appName.NB + `/renewal/renewal/findMinRrtdatFromCovrByChdrnum?chdrnum=${chdrnum}`,
        method: 'get',
    })
}

//检查提核个数
export function countEuruByChdrcoyRrtdatChdrnum(chdrcoy, chdrnum, rrtdat) {
    return request({
        url: appName.NB + `/renewal/renewal/countEuruByChdrcoyRrtdatChdrnum?chdrcoy=${chdrcoy}&chdrnum=${chdrnum}&rrtdat=${rrtdat}`,
        method: 'get',
    })
}

//检查提核状态
export function findMinFlag01EuruByChdrcoyRrtdatChdrnum(chdrcoy, chdrnum, rrtdat) {
    return request({
        url: appName.NB + `/renewal/renewal/findMinFlag01EuruByChdrcoyRrtdatChdrnum?chdrcoy=${chdrcoy}&chdrnum=${chdrnum}&rrtdat=${rrtdat}`,
        method: 'get',
    })
}

//任务已存在数量
export function findClmnumEuruByChdrcoyRrtdatChdrnum(chdrcoy, chdrnum, rrtdat) {
    return request({
        url: appName.NB + `/renewal/renewal/findClmnumEuruByChdrcoyRrtdatChdrnum?chdrcoy=${chdrcoy}&chdrnum=${chdrnum}&rrtdat=${rrtdat}`,
        method: 'get',
    })
}

//提核保存
export function addRenewal(param) {
    return request({
        url: appName.NB + `/renewal/renewal/addRenewal`,
        method: 'post',
        data: param
    })
}

//双击
export function doubleClick(clmnum, archtype, lifcnum, chdrcoy, chdrnum,taskno) {
    return request({
        url: appName.NB + `/renewal/renewal/doubleClick?clmnum=${clmnum}&archtype=${archtype}&lifcnum=${lifcnum}&chdrcoy=${chdrcoy}&chdrnum=${chdrnum}&taskno=${taskno}`,
        method: 'get'
    })
}
//加锁
export function lock(taskno) {
    return request({
        url: appName.TASK + `/renewal/task/lock`,
        method: 'post',
        data: taskno
    })
}

//解锁
export function unlock(taskno) {
    return request({
        url: appName.TASK + `/renewal/task/unlock`,
        method: 'post',
        data:  taskno
    })
}